package com.huifer.wgx.model;

import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * <p>Title : DetectionPointEntity </p>
 * <p>Description : </p>
 *
 * @author huifer
 * @date 2019-03-20
 */
@Entity
@Table(name = "t_detection_point", schema = "at15", catalog = "")
public class DetectionPointEntity {

    private Long detectionId;
    private Long verifyId;
    private String detecionIsok;
    private Long personnelId;
    private Long interiorPointId;
    private VerifyEntity tVerifyByVerifyId;
    private PersonnelEntity tPersonnelByPersonnelId;
    private InteriorPointEntity tInteriorPointByInteriorPointId;

    @Id
    @Column(name = "detection_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getDetectionId() {
        return detectionId;
    }

    public void setDetectionId(Long detectionId) {
        this.detectionId = detectionId;
    }

    @Basic
    @Column(name = "verify_id")
    public Long getVerifyId() {
        return verifyId;
    }

    public void setVerifyId(Long verifyId) {
        this.verifyId = verifyId;
    }

    @Basic
    @Column(name = "detecion_isok")
    public String getDetecionIsok() {
        return detecionIsok;
    }

    public void setDetecionIsok(String detecionIsok) {
        this.detecionIsok = detecionIsok;
    }

    @Basic
    @Column(name = "personnel_id")
    public Long getPersonnelId() {
        return personnelId;
    }

    public void setPersonnelId(Long personnelId) {
        this.personnelId = personnelId;
    }

    @Basic
    @Column(name = "interior_point_id")
    public Long getInteriorPointId() {
        return interiorPointId;
    }

    public void setInteriorPointId(Long interiorPointId) {
        this.interiorPointId = interiorPointId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        DetectionPointEntity that = (DetectionPointEntity) o;
        return Objects.equals(detectionId, that.detectionId) &&
                Objects.equals(verifyId, that.verifyId) &&
                Objects.equals(detecionIsok, that.detecionIsok) &&
                Objects.equals(personnelId, that.personnelId) &&
                Objects.equals(interiorPointId, that.interiorPointId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(detectionId, verifyId, detecionIsok, personnelId, interiorPointId);
    }

    @ManyToOne
    @JoinColumn(name = "verify_id", referencedColumnName = "verify_id",insertable = false,updatable = false)
    public VerifyEntity gettVerifyByVerifyId() {
        return tVerifyByVerifyId;
    }

    public void settVerifyByVerifyId(VerifyEntity tVerifyByVerifyId) {
        this.tVerifyByVerifyId = tVerifyByVerifyId;
    }

    @ManyToOne
    @JoinColumn(name = "personnel_id", referencedColumnName = "personnel_id",insertable = false,updatable = false)
    public PersonnelEntity gettPersonnelByPersonnelId() {
        return tPersonnelByPersonnelId;
    }

    public void settPersonnelByPersonnelId(PersonnelEntity tPersonnelByPersonnelId) {
        this.tPersonnelByPersonnelId = tPersonnelByPersonnelId;
    }

    @ManyToOne
    @JoinColumn(name = "interior_point_id", referencedColumnName = "interior_point_id",insertable = false,updatable = false)
    public InteriorPointEntity gettInteriorPointByInteriorPointId() {
        return tInteriorPointByInteriorPointId;
    }

    public void settInteriorPointByInteriorPointId(
            InteriorPointEntity tInteriorPointByInteriorPointId) {
        this.tInteriorPointByInteriorPointId = tInteriorPointByInteriorPointId;
    }
}
